package com.fourth_groups.shopping121store.ui.person.view;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

import com.fourth_groups.shopping121store.R;

public class PasswordActivity extends AppCompatActivity {

    private EditText password;
    private EditText new_passwor;
    private EditText password1;
    private Button btn;
    private Button phonetext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_password);
        initview();

    }

    private void initview() {
        password = (EditText) findViewById(R.id.old_password);
        new_passwor = (EditText) findViewById(R.id.new_password);
        password1 = (EditText) findViewById(R.id.password);
        btn = (Button) findViewById(R.id.password_btn);
        phonetext = (Button) findViewById(R.id.phonetext);
        phonetext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(PasswordActivity.this, "修改链接发送至邮箱", Toast.LENGTH_SHORT).show();
            }
        });
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String pawword = password.getText().toString();
                String new_password = new_passwor.getText().toString();
                String pass=password1.getText().toString();
                if (pawword!=new_password&&pass==new_password){
                    Toast.makeText(PasswordActivity.this, "密码修改成功", Toast.LENGTH_SHORT).show();
                }
            }
        });
    }


}
